#ifndef MISSION_HPP_
#define MISSION_HPP_

/*******************************************************************************
 ** Name: mission.hpp                                                       **
 ** Description:                                                              **
 **                                                                           **
 ** Open Source Initiative (OSI) Approved License                             **
 **                                                                           **
 **  Copyright (c) 2009-2010 Barry "Gian" James  <bjames@munixos.net>         **
 **  All rights reserved.                                                     **
 **                                                                           **
 **  Redistribution and use in source and binary forms, with or without       **
 **  modification, are permitted provided that the following conditions are   **
 **  met:                                                                     **
 **                                                                           **
 **  * Redistributions of source code must retain the above copyright notice, **
 **    this list of conditions and the following disclaimer.                  **
 **  * Redistributions in binary form must reproduce the above copyright      **
 **    notice, this list of conditions and the following disclaimer in the    **
 **    documentation and/or other materials provided with the distribution.   **
 **                                                                           **
 **  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS      **
 ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED **
 ** TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A           **
 ** PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT        **
 ** HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,    **
 ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED  **
 ** TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR    **
 ** PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF    **
 ** LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING      **
 ** NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS        **
 ** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.              **
 **                                                                           **
 ******************************************************************************/
// Created on April 4, 2010, 10:03 AM
// Modified $Date: 2011-09-18 21:48:59 +0000 (Sun, 18 Sep 2011) $ by $Author: gian.james $
#define mission_hpp_ID   "$Id: mission.hpp 145 2011-09-18 21:48:59Z gian.james $"
#include <boost/uuid/uuid.hpp>
#include <boost/uuid/uuid_generators.hpp>
#include <boost/uuid/uuid_io.hpp>

#include <string>
#include "common.hpp"
#include "object.hpp"


enum class MissionObjectiveType {
	SkillCheck, Aid, Acquire, Capture, Confirm, Defend, Destroy,
	Evade, Infiltrate, Investigate, Neutralize, Repair, Craft,
	Rescue, Transport,
	max
};

struct MissionObjective
{
	uint8_t		grade;		// 1 - 10
	MissionObjectiveType	type;
	boost::uuids::uuid 		objectiveID;
};
//! Represents different stages in missions that have them.
//! All missions have at least two stages:
//! Stage 0 - getting the mission and Stage # - mission complete
struct MissionStage
{
	uint8_t			percent;	// this stage represents what percentage complete?
	std::string		desc;
	bool			bComplete;	// the last stage of a mission progression
};

#define MISSION_STAGE_OFFSET	2	// offset into stages[] to get mission
//! The quintessential mission/quest/task/job.
//! The list of
class Mission
{
public:
	Mission(std::string n,int x,WorldObject * wo);
	virtual ~Mission();

	const std::string &		Name() const { return name; }
	int				XP() { return xp; }
	WorldObject *	QuestGiver() { return questGiver; }
	void			NumStages(uint8_t s) { numStages = s; }
	const std::string &		Desc() const { return desc; }
	void			Desc(std::string d) { desc = d; }
	MissionStage *	GetStage(uint8_t s) { if (s <= numStages) return stages[s]; else return NULL; }

private:
	std::string		name;
	std::string		desc;
	int		xp;		// how much is this mission worth
	WorldObject * 	questGiver;	// why isn't this npc?
	MissionStage **	stages;
	uint8_t			numStages;
	MissionObjective	objective;
};




#endif /* MISSION_HPP_ */
